<?php

namespace App\Http\Controllers\BK;

use App\Http\Controllers\Controller;
use App\Http\Requests\BK\User\ChatHistoryRequest;
use App\Http\Requests\BK\User\ModifyCreditsRequest;
use App\Http\Requests\BK\User\UpdateUserRequest;
use App\Http\Requests\BK\User\UserIndexRequest;
use App\Services\ChatService;
use App\Services\UserService;
use Illuminate\Http\Request;

class UserController extends Controller
{
    public function __construct()
    {
        $this->middleware(['auth:admins']);
    }

    public function index(UserIndexRequest $request,UserService $userService)
    {
        return success($userService->adminIndexUser($request->validated()));
    }

    public function show(int $id,UserService $userService)
    {
        return success($userService->showUser($id));
    }

    public function update(UpdateUserRequest $request,UserService $userService)
    {
        return success($userService->updateUser($request->validated()));
    }
}
